CC = g++
INCLUDE = -I/home/fredrik/opencl/include
CFLAGS = -Wall -O2 -std=c++0x $(INCLUDE)
COMPILE = $(CC) $(CFLAGS) -c
OBJFILES := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
LIBS = -lGLEW -lglut -lGLU -lOpenCL
LIBDIR = -L/home/fredrik/opencl/lib/x86

all : rigidbody

rigidbody : $(OBJFILES)
	$(CC) $(LIBDIR) $(LIBS) -o rigidbody $(OBJFILES)
%.o : %.cpp %.h 
	$(COMPILE) -o $@ $<
tags : 
	ctags *.h *.cpp

clean :
	rm -f $(OBJFILES) rigidbody

run : rigidbody
	./rigidbody

.PHONY : all clean tags run
